#include "Observable.h"

Observable::Observable () : observers()
{
	// Nothing to do here.
}

void Observable::addObserver (Observer * observer)
{
	observers.insert(observer);
}

void Observable::removeObserver (Observer * observer)
{
	observers.erase(observer);
}

void Observable::notifyAll (int eventCode)
{
	std::set<Observer *>::iterator it;

	for (it = observers.begin(); it != observers.end(); it++)
		(*it)->notify(this, eventCode);
}